<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="/static/pear/component/pear/css/pear.css" />
<body>
<form class="layui-form" lay-filter="component-form-group">
    <div class="mainBox  layui-card-body" style="padding: 0 0;">
        <div class="main-container">
            <div class="layui-form-item">
                <label class="layui-form-label">员工工号</label>
                <div class="layui-input-block">
                    <input type="text"value="{$inf.userid}" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">员工姓名</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.name}" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>



            <div class="layui-form-item">
                <label class="layui-form-label">当前积分</label>
                <div class="layui-input-block">
                    <input type="number" value="{$inf.num}" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">加/减分值*</label>
                <div class="layui-input-block">
                    <input type="number" name="score" lay-verify="required" autocomplete="off" placeholder="请输入积分" class="layui-input">
                </div>
            </div>
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux">示例：30 或 -30</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注说明*</label>
                <div class="layui-input-block">
                    <input type="text" name="remark" lay-verify="required" autocomplete="off" placeholder="请输入备注说明" class="layui-input">
                </div>
            </div>
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux">中文标题不超过20个汉字，英文标题不超过40个字符</div>
            </div>
            <input type="hidden" name="id" value="{$inf.id}">
            {:token_field()}
        </div>
    </div>


    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
{include file="_Fragment/javascript" /}
<script src="/static/common/jquery-3.6.0.min.js"></script>
<script>
    layui.use(['table', 'form', 'jquery', 'element'], function() {
        let form = layui.form;
        let table = layui.table;
        let $ = layui.jquery;


        form.on('submit(user-save)', function(data) {
            let loading = layer.load();
            $.ajax({
                url: '/IntegralRecord/changeModify',
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function(result) {
                    layer.close(loading);
                    if (result.status == 0) {
                        layer.msg(result.msg, {
                            icon: 1,
                            time: 1000
                        }, function() {
                            parent.layer.close(parent.layer.getFrameIndex(window
                                .name)); //关闭当前页
                            parent.layui.table.reload("user-table");
                        });
                    } else {
                        layer.msg(result.msg, {
                            icon: 2,
                            time: 1000
                        });
                    }
                }
            })
            return false;
        });
    })
</script>
<script>
</script>
</body>
</html>